import request from '@/utils/request'

// 查询出入库请求记录列表
export function listRequest(query) {
  return request({
    url: '/scm/request/list',
    method: 'get',
    params: query
  })
}

// 查询出入库请求记录详细
export function getRequest(id) {
  return request({
    url: '/scm/request/' + id,
    method: 'get'
  })
}

// 新增出入库请求记录
export function addRequest(data) {
  return request({
    url: '/scm/request',
    method: 'post',
    data: data
  })
}

// 修改出入库请求记录
export function updateRequest(data) {
  return request({
    url: '/scm/request',
    method: 'put',
    data: data
  })
}

// 删除出入库请求记录
export function delRequest(id) {
  return request({
    url: '/scm/request/' + id,
    method: 'delete'
  })
}


// 上传并处理入库计划的xls文件
export function processXLSAndGenerateLibInPlan(formData) {
  return request({
    url: '/scm/request/processXLSAndGenerateLibInPlan',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data: formData
  });

  // 上传并处理入库计划的xls文件

}


export function processXLSAndGenerateLibOutPlan(formData) {
  return request({
    url: '/scm/request/processXLSAndGenerateLibOutPlan',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data: formData
  });
}